//
//  TYScenarioInterpretation.m
//  AngerDragon
//
//  Created by gaotime_macbook_2 on 11-12-14.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "TYScenarioInterpretationSingleton.h"
#import "cocos2d.h"

@implementation TYScenarioInterpretationSingleton

static TYScenarioInterpretationSingleton *myInstance = nil;



/// ios实现单例, 要这样做, 因为没有私有构造的概念
+(id)alloc {
	NSAssert(myInstance == nil, @"Attempted to allocate a second instance of a singleton.");
	return [super alloc];
}

/// 单例方法
+ (id<TYScenarioInterpretationProtocol>) sharedInstance {
	if (nil == myInstance) {
		
		myInstance = [[[self class] alloc] init];
	}
	
	return myInstance;
}



- (id) init {
	
	if ((self = [super init])) {
		CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
		
		
	}
	
	return self;
}

- (void) dealloc {
	CCLOG(@"%@: %@", NSStringFromSelector(_cmd), self);
	
	/// 
	myInstance = nil;
	
	
	[super dealloc];
}

#pragma mark 实现 对外的接口行为
/// 随着时间轴来解读剧本, 然后创建相应精灵对象,挂接到对应的集合中
- (void) scenarioInterpretationLoop:(ccTime) delta {
}
/// 告诉外界, 本关游戏是否胜利
- (BOOL) isWin {
	return NO;
}
/// 敌人精灵在其被player消灭时, 调用此接口, 来告知剧本模块累加已经死亡的敌对精灵
- (void) oneEnemySpriteDead {
}

- (void) deallocMe {
	[self dealloc];
}
@end
